
const pickerOptions = {
  disabledDate(time) {
    return time.getTime() > Date.now();
  },
  shortcuts: [
    {
      text: "今天",
      onClick(picker) {
        picker.$emit("pick", new Date());
      }
    },
    {
      text: "昨天",
      onClick(picker) {
        const date = new Date();
        date.setTime(date.getTime() - 3600 * 1000 * 24);
        picker.$emit("pick", date);
      }
    },
    {
      text: "一周前",
      onClick(picker) {
        const date = new Date();
        date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
        picker.$emit("pick", date);
      }
    },
    {
      text: "一年前",
      onClick(picker) {
        const date = new Date();
        date.setFullYear(date.getFullYear() - 1);
        picker.$emit("pick", date);
      }
    },
    {
      text: "两年前",
      onClick(picker) {
        const date = new Date();
        date.setFullYear(date.getFullYear() - 2);
        picker.$emit("pick", date);
      }
    },
    {
      text: "三年前",
      onClick(picker) {
        const date = new Date();
        date.setFullYear(date.getFullYear() - 3);
        picker.$emit("pick", date);
      }
    }
  ]
};

export {  pickerOptions};
